<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>wenjuandiaocha</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="/js/vue.js"></script>
    <!-- 引入样式element-->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <!-- 引入cookie -->
    <script src="https://cdn.bootcss.com/js-cookie/latest/js.cookie.min.js"></script>
    <!-- 使用element中的组件v-chart图表 -->
    <script src="//unpkg.com/echarts/dist/echarts.min.js"></script>
    <script src="//unpkg.com/v-charts/lib/index.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            font-size: 15px;
            /* 可以消除边框对长宽的影响 */
        }

        #container {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        a {
            text-decoration: none;
        }

        .logo {
            width: 94%;
            margin: 0 auto;
            height: 13%;
        }

        .logo img {
            height: 66px;
            margin: 7px 0;
        }

        .logo .logout {
            height: 80px;
            line-height: 80px;
            float: right;
            color: black;
        }

        #content {
            overflow-y: scroll;
            height: 82%;
        }

        #cleft {
            position: absolute;
            left: 0;
            width: 20%;
            float: left;
        }

        #cleft #user {
            padding: 0 15px;
            height: 30px;
            margin: 25px 0;
            background-color: #1EA0FA;
            line-height: 30px;
            text-align: center;
            position: fixed;
            top: 0px;
            right: 100px;
            color: #fff;
            border-radius: 20px;
        }

        #cright {
            width: 80%;
            height: 82%;
            overflow-y: scroll;
            position: absolute;
            right: 0;
        }

        #cright .rc {
            width: 100%;
            height: 450px;
            background: rgba(235, 226, 226, 0.74) url("/img/banner.png") no-repeat center;
        }

        #cright .rc h1 {
            padding-left: 80px;
            line-height: 100px;
            font-size: 60px;
            padding-top: 100px;
            margin-bottom: 24px;
            font-weight: normal;
            font-family: "microsoft yahei";
            color: #fff;
        }

        #cright .rc h2 {
            padding-left: 80px;
            font-size: 30px;
            font-weight: lighter;
            margin-bottom: 4px;
            line-height: 100px;
            font-family: "microsoft yahei";
            color: #fff;
        }

        #footer {
            position: absolute;
            bottom: 0;
            height: 5%;
            width: 100%;
            line-height: 60px;
            text-align: center;
            color: rgb(135, 135, 135);
        }
    </style>
</head>

<body>
    <div id="container">
        <div class="logo">
            <img src="/img/logo.png" alt="">
            <!-- 注销 -->
            <span class="logout">
                <a href="/logout">注销</a>
            </span>
        </div>
        <div id="content">
            <div id="cleft">
                <div id="user">
                    {{rendata.username}}
                </div>
                <el-menu default-active="2" class="el-menu-vertical-demo" @select="loadPage">
                    <el-menu-item index="/nav/aa.html">
                        <span slot="title">用户管理</span>
                    </el-menu-item>
                    <el-menu-item index="/nav/outline.html">
                        <span slot="title">大纲管理 </span>
                    </el-menu-item>
                    <el-menu-item index="/nav/papers.html">
                        <span slot="title">问卷管理</span>
                    </el-menu-item>
                    <el-menu-item index="/nav/daan.html">
                        <span slot="title">选项管理</span>
                    </el-menu-item>
                    <el-menu-item index="/nav/mine.html">
                        <span slot="title">个人中心</span>
                    </el-menu-item>
                </el-menu>
            </div>
            <div id="cright">
                <div class="rc">
                    <h1>欢迎登陆</h1>
                    <h2>问卷管理系统</h2>
                </div>
            </div>
        </div>
        <div id="footer">
            长沙冉星信息科技有限公司 版权所有 ICP证:43019002000245 湘ICP备17005436号-1 湘公网安备 43019002000245号 工商网监 安全联盟认证 工商网监 认证联盟
        </div>
    </div>
</body>

</html>
<script>
    var indexVm = new Vue({
        el: '#cleft',
        data: function () {
            return {
                rendata: [],
            }
        },
        methods: {
            loadPage: function (index) {
                $.get(index, function (result) {
                    $("#cright").html(result)
                })
            }

        },
        created: function () {
            var _this = this
            $.get('/ren/get', function (result) {
                if (result.error != 0) { return }
                _this.rendata = result.data[0]
                console.log(_this.rendata)
            })
        },

    })
</script>